/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.himilco.test;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author oussema
 */
@Entity
@Table(name = "atmincidents_devices")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "AtmincidentsDevices.findAll", query = "SELECT a FROM AtmincidentsDevices a"),
    @NamedQuery(name = "AtmincidentsDevices.findByDeviceId", query = "SELECT a FROM AtmincidentsDevices a WHERE a.deviceId = :deviceId"),
    @NamedQuery(name = "AtmincidentsDevices.findByDeviceSerialNumber", query = "SELECT a FROM AtmincidentsDevices a WHERE a.deviceSerialNumber = :deviceSerialNumber"),
    @NamedQuery(name = "AtmincidentsDevices.findByDeviceType", query = "SELECT a FROM AtmincidentsDevices a WHERE a.deviceType = :deviceType"),
    @NamedQuery(name = "AtmincidentsDevices.findByAtmId", query = "SELECT a FROM AtmincidentsDevices a WHERE a.atmId = :atmId"),
    @NamedQuery(name = "AtmincidentsDevices.findByStateId", query = "SELECT a FROM AtmincidentsDevices a WHERE a.stateId = :stateId"),
    @NamedQuery(name = "AtmincidentsDevices.findByCreateUid", query = "SELECT a FROM AtmincidentsDevices a WHERE a.createUid = :createUid"),
    @NamedQuery(name = "AtmincidentsDevices.findByUpdateUid", query = "SELECT a FROM AtmincidentsDevices a WHERE a.updateUid = :updateUid"),
    @NamedQuery(name = "AtmincidentsDevices.findByCreateTs", query = "SELECT a FROM AtmincidentsDevices a WHERE a.createTs = :createTs"),
    @NamedQuery(name = "AtmincidentsDevices.findByUpdateTs", query = "SELECT a FROM AtmincidentsDevices a WHERE a.updateTs = :updateTs")})
public class AtmincidentsDevices implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "DEVICE_ID")
    private Integer deviceId;
    @Size(max = 20)
    @Column(name = "DEVICE_SERIAL_NUMBER")
    private String deviceSerialNumber;
    @Size(max = 20)
    @Column(name = "DEVICE_TYPE")
    private String deviceType;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ATM_ID")
    private int atmId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "STATE_ID")
    private int stateId;
    @Column(name = "CREATE_UID")
    private Integer createUid;
    @Column(name = "UPDATE_UID")
    private Integer updateUid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "CREATE_TS")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTs;
    @Basic(optional = false)
    @NotNull
    @Column(name = "UPDATE_TS")
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTs;

    public AtmincidentsDevices() {
    }

    public AtmincidentsDevices(Integer deviceId) {
        this.deviceId = deviceId;
    }

    public AtmincidentsDevices(Integer deviceId, int atmId, int stateId, Date createTs, Date updateTs) {
        this.deviceId = deviceId;
        this.atmId = atmId;
        this.stateId = stateId;
        this.createTs = createTs;
        this.updateTs = updateTs;
    }

    public Integer getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(Integer deviceId) {
        this.deviceId = deviceId;
    }

    public String getDeviceSerialNumber() {
        return deviceSerialNumber;
    }

    public void setDeviceSerialNumber(String deviceSerialNumber) {
        this.deviceSerialNumber = deviceSerialNumber;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public int getAtmId() {
        return atmId;
    }

    public void setAtmId(int atmId) {
        this.atmId = atmId;
    }

    public int getStateId() {
        return stateId;
    }

    public void setStateId(int stateId) {
        this.stateId = stateId;
    }

    public Integer getCreateUid() {
        return createUid;
    }

    public void setCreateUid(Integer createUid) {
        this.createUid = createUid;
    }

    public Integer getUpdateUid() {
        return updateUid;
    }

    public void setUpdateUid(Integer updateUid) {
        this.updateUid = updateUid;
    }

    public Date getCreateTs() {
        return createTs;
    }

    public void setCreateTs(Date createTs) {
        this.createTs = createTs;
    }

    public Date getUpdateTs() {
        return updateTs;
    }

    public void setUpdateTs(Date updateTs) {
        this.updateTs = updateTs;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (deviceId != null ? deviceId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AtmincidentsDevices)) {
            return false;
        }
        AtmincidentsDevices other = (AtmincidentsDevices) object;
        if ((this.deviceId == null && other.deviceId != null) || (this.deviceId != null && !this.deviceId.equals(other.deviceId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.himilco.test.AtmincidentsDevices[ deviceId=" + deviceId + " ]";
    }
    
}
